var express = require("express");
var router = express.Router();
const connection = require('../db/index') // 获取连接实例

/* GET users listing. */       
router.get("/", function (req, res, next) {
  connection.query('select * from users', (err, users) => {
    if(err) {
      res.error(`something error at: ${err}`)
    } else {
      res.send(users)
    }
  })
  // res.ok(req.getParams())
});

module.exports = router;
